#ifndef ACTOR_H
#define ACTOR_H

#include "MoveableObject.h"
#include "Stats.h"

static const float moveRange = 12.0f;

enum ResourceType
{
	RES_HEALTH_CAP,
	RES_ENERGY_CAP,
	RES_HEALTH,
	RES_ENERGY
};

class Actor : public MoveableObject
{
public:
	Actor(std::string id);
	Actor(boost::shared_ptr<SettingsManager> sm);
	~Actor(void);

	float getResources(ResourceType type);
	void updateActor();
	bool changeResources(ResourceType type, float amount);
	void setResources(ResourceType type, float amount);
	void resetResources();
	boost::shared_ptr<Stats> getStats();
	void setHitEnemy(const bool hit);

	virtual void recieveDmg(const btVector3 &pos, const float dmg);
	virtual void knockBack(btVector3 &dir);
	virtual void stun(const float dur);
	virtual void scalePower(const char power);
	void updateStun(const unsigned long elapsedTime);
	void updateInvulnerable(const unsigned long elapsedTime);

	bool isInRangeTo(boost::shared_ptr<BaseObject> target);

protected:
	void readActorFromXML(std::string id);
	void readActorFromXML(boost::shared_ptr<SettingsManager> sm);
	void initActor(std::string id);
	float mHealthCap, mEnergyCap;
	float mHealth, mEnergy;
	void createRewardOrb(RewardType);
	boost::shared_ptr<Stats> mStats;
	float mStun;
	float mInvulnerable;
	bool mHitEnemy;
};
typedef boost::shared_ptr<Actor> ActorPtr;
#endif